#!/bin/sh
# awk_to_shell.sh - Deliver Variable from awk to shell.

var1="test"
var2="along"
nr=0
echo "var1: $var1"
echo "var2: $var2"
file=/etc/passwd

eval $(awk -F ":" 'BEGIN{file="'$file'";print "var1=along;var2=test"}{if ($1 ~/bin/) print NR}' $file)
echo "nr: $nr"
echo "var1: $var1"
echo "var2: $var2"
